package contracheque.calculo;

public class Inss extends Imposto {

    private double teto;
    
    public Inss() {
        this.teto = 457.49;
        
        this.minimo = new double[3];
        this.maximo = new double[3];
        this.percentual = new double[3];
        
        this.minimo[0] = 0;
        this.maximo[0] = 1247.70;
        this.percentual[0] = 8;
        
        this.minimo[1] = 1247.71;
        this.maximo[1] = 2079.50;
        this.percentual[1] = 9;
        
        this.minimo[2] = 2079.51;
        this.maximo[2] = 9999999; // 4159.00
        this.percentual[2] = 11;
    }   
    
    public double calcularValor(double salario, boolean limitarTeto) {
        double valor = super.calcularValor(salario);
        if ( limitarTeto && valor > teto ) {
            return teto;
        }
        return valor;
    }
}
